package interpreter;

import node.AAspect;
import node.AAspectDeclStatement;
import node.APreprocFile;
import node.AProperty;
import node.APropertyDeclStatement;
import node.AStatementsFileElements;
import node.PAspect;
import node.PFileElements;
import node.PProperty;
import node.PStatement;
import analysis.DepthFirstAdapter;

public class PropertyRecognizer extends DepthFirstAdapter { 
	
	public void caseAProperty(AProperty node){ 
		System.out.println(node.getIdentifier());
	}

	public void caseAPreprocFile(APreprocFile node){ 
		if(node.getFileElements()!=null && !node.getFileElements().isEmpty()){
			for(PFileElements element: node.getFileElements()){
				if(element instanceof AStatementsFileElements){				
					PStatement statement = ((AStatementsFileElements) element).getStatement();
					if(statement instanceof APropertyDeclStatement){
						PProperty prop = ((APropertyDeclStatement) statement).getProperty();
						AProperty aprop = (AProperty) prop;
						System.out.println(aprop.getIdentifier());
					}
				}
			}
		}
	}
}